package org.example.Server.mapper.home;

import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.example.Server.model.commen.Direction;
import org.example.Server.model.home.*;
import org.example.Server.utils.ResultAPI;

import java.util.List;

@Mapper
public interface HomeMapper {
    List<SlideShowDTO> getSlider(int semCnt);

    List<CourseTeamDTO> getCourseTeam(int courseId);

    String getCourseIntro(int courseId);

    Page<NewReplyVO> selectByPageOrderByTime(NewReplyDTO newReplyDTO);

    Page<NewReplyVO> selectByPageOrderByComment(NewReplyDTO newReplyDTO);

    Page<NewReplyVO> selectByPageAndType(NewReplyDTO newReplyDTO);

    Page<Comment> selectCommentByPostId(int postId);

    TypeReplyVO selectTopicById(int postId);

    @Insert("insert into post ( publisher_id, course_id, post_content, post_type, update_time, post_title,direction_id) " +
            "value (#{publisher_id}, #{course_id}, #{post_content}, #{post_type}, #{update_time}, #{post_title},#{direction_id})")
    void insertPost(Post post);

    List<Direction> getDirection();

    HomeData getHomeData();
}
